import { request } from ".";
import nprogress from 'nprogress'
request.interceptors.request.use((config) => {
    nprogress.start()
    return config
})
request.interceptors.response.use((response) => {
    nprogress.done()
    // 数据返回
    if (response.data.code === 200) {
        return response.data.data
    } else {
        return Promise.reject(response.data.message)
    }

})
export default request